const mysql = require('mysql');

//  创建连接
const connection = mysql.createConnection({
host : 'localhost',
port : '8889',
user : 'root',
password : 'root',
database : 'movie_douban'
});
//  执行创建连接
connection.connect();

const id = 8;
const sql = "DELETE FROM `movie_list` WHERE id = ?";

connection.query(sql, [id], (err, res) => {
    if (err) {
        console.log('DELETE ERROR WHILE ID = ' + id, err);
    } else {
        console.log('DELETE SUCCESS');
    }
});

// 断开
connection.end();

// 执行完结束进程
// process.exit(0);